﻿<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl" xmlns:wvrm="http://ns.woodbase.dk/Menu.xsd"
>
    <xsl:output method="xml" indent="yes"/>

    <xsl:template match="/wvrm:menuitem">
      <ul class="mainmenu">
        <li>
          <a href="{/wvrm:menuitem/@url}">
            <xsl:value-of select="@title"/>
          </a>
          <xsl:call-template name="HTMLEntity"><xsl:with-param name="code">nbsp</xsl:with-param></xsl:call-template>|
        </li>
        <xsl:for-each select="/wvrm:menuitem/wvrm:menuitem">
          <li>
            <a href="{@url}">
              <xsl:value-of select="@title"/>
            </a>
            <xsl:call-template name="HTMLEntity"><xsl:with-param name="code">nbsp</xsl:with-param></xsl:call-template>|
          </li>
        </xsl:for-each>
      </ul>
    </xsl:template>

  <xsl:template name="HTMLEntity">
    <xsl:param name="code" />
    <xsl:text disable-output-escaping="yes">&amp;</xsl:text><xsl:value-of select="$code"/>;
  </xsl:template>
</xsl:stylesheet>
